package com.york.user.entity;

import com.york.user.enums.DeleteFlag;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

@Data
public class MybatisBaseEntity implements Serializable {
    private String createBy;

    private Date createTime;

    private String updateBy;

    private Date updateTime;

    private Integer deleteFlag;

    private Integer version;

    public void setVersion(Integer version) {
        this.version = version;
    }

    public void insertFill() {
        this.createBy = "York";
        this.createTime = new Date();
        this.deleteFlag = DeleteFlag.NORMAL.getValue();
        this.version = 0;
    }

    public void updateFill() {
        this.updateBy = "York";
        this.updateTime = new Date();
    }

}